/**
 *  work space script
 *
 *  @author : jihuaizhi
 *  @Time   : 2010.03.22 21:08:10 CST
 *  @note   :
 */
import mx.collections.ArrayCollection;
import mx.controls.Button;
import mx.core.Application;
import mx.utils.ObjectUtil;
import mx.containers.ApplicationControlBar;
import mx.core.Application;
import com.basestone.pdlmis.util.*;

[Bindable]
public var yearComboData:ArrayCollection;

[Bindable]
public var monthComboData:ArrayCollection=new ArrayCollection([{label: "January", value: 1, date: 31}, {label: "February", value: 2, date: 28}, {label: "March", value: 3, date: 31}, {label: "April", value: 4, date: 30}, {label: "May", value: 5, date: 31}, {label: "June", value: 6, date: 30}, {label: "July", value: 7, date: 31}, {label: "August", value: 8, date: 31}, {label: "September", value: 9, date: 30}, {label: "October", value: 10, date: 31}, {label: "November", value: 11, date: 30}, {label: "December", value: 12, date: 31}]);

private var today:Date;
public var selectedButton:*;
private var minimumWidth:int=1000;



public function closeView(event:Event=null):void
{
    Application.application.frameView.currentState="";
    Application.application.frameView.leftView.leftViewStack.selectedChild=Application.application.frameView.leftView.leftSmallItemView;
}

public function selectDefaultButton(event:*):void
{
    this.selectedChild=this.bugListMenuGroup;
    this.selectedButton=this.myBugList0;
    this.selectButton();
}

public function selectButton(event:Event=null):void
{
    if (event == null)
    {
        selectedButton=this.selectedButton;
    }
    else
    {
        selectedButton=event.currentTarget;
    }

    switch (selectedButton)
    {
        case myBugList0:
            Application.application.frameView.openListView();
            break;
        case myBugList1:
            Application.application.frameView.openListView();
            break;
        case myBugList2:
            Application.application.frameView.openListView();
            break;
        case myBugList3:
            Application.application.frameView.openListView();
            break;
        case myBugList4:
            Application.application.frameView.openListView();
            break;
        case myBugList5:
            Application.application.frameView.openListView();
            break;
        case allBugList33:
            Application.application.frameView.openListView();
            break;
        case allBugList323:
            Application.application.frameView.openListView();
            break;
        case btn1:
            Application.application.frameView.mainView.mainViewStack.selectedChild=Application.application.frameView.mainView.defectAnalysisTableView;
            break;
        case btn3:
            Application.application.frameView.mainView.mainViewStack.selectedChild=Application.application.frameView.mainView.defectTrendView;
            break;
        case btn2:
            Application.application.frameView.mainView.mainViewStack.selectedChild=Application.application.frameView.mainView.defectGrowingView;
            break;
        case btn4:
            Application.application.frameView.mainView.mainViewStack.selectedChild=Application.application.frameView.mainView.defectPeopleView;
            break;

        case btn11:
            Application.application.frameView.mainView.mainViewStack.selectedChild=Application.application.frameView.mainView.dictionaryView;
            break;
        case btn12121:
            Application.application.frameView.mainView.mainViewStack.selectedChild=Application.application.frameView.mainView.templateView;
            break;

        default:
            break;
    }
}

private function accordionChangeEventHandler(event:Event):void
{
    if (event != null)
    {
        this.bugListMenuGroup.verticalScrollPosition=0;
        this.secondMenuGroup.verticalScrollPosition=0;
    }
}